<% unless @events_by_day.empty? %>
  <div id="activity">
    <% @events_by_day.keys.sort.reverse.each do |day| %>
    <h4><%= format_activity_day(day) %></h4>
    <dl>
    <% @events_by_day[day].sort {|x,y| y.event_datetime <=> x.event_datetime }.each do |e| -%>
      <dt class="<%= e.event_type %>">
      <span class="time"><%= format_time(e.event_datetime, false) %></span>
      <%= content_tag('span', h(e.project), :class => 'project') %>
      <%= link_to format_activity_title(e.event_title), e.event_url %></dt>
      <dd><span class="description"><%= format_activity_description(e.event_description) %></span></dd>
    <% end -%>
    </dl>
    <% end -%>
  </div>
  <%= link_to l(:label_activity) + " \xc2\xbb", :controller => 'activities',
                :action => 'index', :id => nil, :user_id => @person,
                :from => @events_by_day.keys.first %>
<% end -%>